home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / samples / api / module.c < prev   
Encoding:
C/C++ Source or Header  |  1997-01-17  |  1.2 KB  |  47 lines

  1. /*      module.c
  2.  *
  3.  * A minimal module playing example with the DLL API
  4.  *
  5.  * Copyright 1996,1997 Housemarque Inc.
  6.  *
  7.  * This file is part of the MIDAS Sound System, and may only be
  8.  * used, modified and distributed under the terms of the MIDAS
  9.  * Sound System license, LICENSE.TXT. By continuing to use,
  10.  * modify or distribute this file you indicate that you have
  11.  * read the license and understand and accept it fully.
  12. */
  13.  
  14. #include <stdio.h>
  15. #include <conio.h>
  16. #include "midasdll.h"
  17.  
  18.  
  19.  
  20. int main(void)
  21. {
  22.     MIDASmodule module;
  23.  
  24.     /* Error checking has been removed for clarity - see other API examples */
  25.  
  26.     /* Initialize MIDAS and start background playback: */
  27.     MIDASstartup();
  28.     MIDASinit();
  29.     MIDASstartBackgroundPlay(0);
  30.  
  31.     /* Load the module and start playing: */
  32.     module = MIDASloadModule("..\\data\\templsun.xm");
  33.     MIDASplayModule(module, 0);
  34.  
  35.     puts("Playing - press any key");
  36.     getch();
  37.  
  38.     /* Stop playing and deallocate module: */
  39.     MIDASstopModule(module);
  40.     MIDASfreeModule(module);
  41.  
  42.     /* Stop background playback and uninitialize MIDAS: */
  43.     MIDASstopBackgroundPlay();
  44.     MIDASclose();
  45.  
  46.     return 0;
  47. }